package com.sz.mes.dto;

import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.sz.mes.entity.Outbound;
import com.diboot.iam.entity.IamUser;
import com.sz.mes.entity.Worksheet;
import com.sz.mes.vo.ShelfIdAndGoodQuantityVO;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.List;
import java.util.Date;
import com.diboot.core.util.D;
import com.sz.mes.entity.Goods;

/**
 * 出库 DTO定义
 * @author hem
 * @version 1.0
 * @date 2023-05-25
 * Copyright © szhs
 */
@Getter
@Setter
@Accessors(chain = true)
public class OutboundDTO extends Outbound {

    private static final long serialVersionUID = -8761006395721269606L;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindQuery(comparison = Comparison.EQ, entity = IamUser.class, field = "realname", condition = "this.recive_user_id=id")
    private String receiveUser;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindQuery(comparison = Comparison.EQ, entity = IamUser.class, field = "realname", condition = "this.create_by=id")
    private String createByName;

    private List<ShelfIdAndGoodQuantityVO> outFromLatticeList;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindQuery(comparison = Comparison.EQ, entity = IamUser.class, field = "realname", condition = "this.update_by=id")
    private String updateByName;

    /**
     * 创建时间-起始
     */
    @BindQuery(comparison = Comparison.GE, field = "createTime")
    private Date createTime;

    /**
     * 创建时间-截止
     */
    @BindQuery(comparison = Comparison.LT, field = "createTime")
    private Date createTimeEnd;

    /**
     * 更新时间-起始
     */
    @BindQuery(comparison = Comparison.GE, field = "updateTime")
    private Date updateTime;

    /**
     * 更新时间-截止
     */
    @BindQuery(comparison = Comparison.LT, field = "updateTime")
    private Date updateTimeEnd;

    /**
     * 关联字段 商品.商品名称：Goods.goodsName
     */
    @BindQuery(comparison = Comparison.EQ, entity = Goods.class, field = "goodsName", condition = "this.goods_id=id")
    private String goodsGoodsName;

    @Override()
    public Date getCreateTime() {
        return this.createTime;
    }

    @Override()
    public Outbound setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public Date getCreateTimeEnd() {
        return D.nextDay(createTime);
    }

    public Outbound setCreateTimeEnd(Date createTimeEnd) {
        this.createTimeEnd = createTimeEnd;
        return this;
    }

    @Override()
    public Date getUpdateTime() {
        return this.updateTime;
    }

    @Override()
    public Outbound setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public Date getUpdateTimeEnd() {
        return D.nextDay(updateTime);
    }

    public Outbound setUpdateTimeEnd(Date updateTimeEnd) {
        this.updateTimeEnd = updateTimeEnd;
        return this;
    }
}
